package components;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;


public class Story {
	
	private HashMap<Integer,Chapter> chapters;
	private Chapter currentChapter;
	
	public Story ()
	{
		chapters=new HashMap<Integer,Chapter> ();
	}

	public void addChapter(int chapterNumber, Chapter c)
	{
		this.chapters.put(new Integer(chapterNumber), c);
	}
	
	public HashMap<Integer,Chapter> getChapterMap()
	{
		return chapters;
	}
	
	public Collection<Chapter> getChapters(){
		return chapters.values();
	}
	
	public int getNumberOfChapters()
	{
	 return chapters.size();
	}

	public void setCurrentChapter(int currentChapter) {
		this.currentChapter = chapters.get(new Integer(currentChapter));
	}

	public Chapter getCurrentChapter() {
		return currentChapter;
	}
	
	public Chapter getChapter(int i)
	{
		return chapters.get(i);
	}
}
